package network.server;

import network.SocketConnection;

import java.io.IOException;
import java.net.Socket;

public class ClientSocket extends SocketConnection {
    private String login = "";

    public void setLogin(String login) {
        this.login = login;
    }

    public ClientSocket(Socket requestSocket) throws IOException {
        super(requestSocket);
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ClientSocket that = (ClientSocket) o;

        if (!login.equals(that.login)) return false;

        return true;
    }

    @Override
    public int hashCode() {
        return login.hashCode();
    }

    public String getLogin() {
        return login;
    }
}
